/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ravennet.dataobject;

import java.io.Serializable;

/**
 *
 * @author Rav
 */
public class TableroDataObject implements Serializable{
    
    private static final long serialVersionUID = 2L;
    
    private CasillaDataObject[][] tablero = new CasillaDataObject[15][15];
    
    public TableroDataObject(){
    }
    
    public TableroDataObject(CasillaDataObject[][] tablero){
        this.tablero=tablero;
    }
    
    public void setCasilla(int i, int j, CasillaDataObject casilla){
        this.tablero[i][j]=casilla;
    }
    
    public void setCasilla(int i, int j, String letra){
        this.tablero[i][j].getLetraAsignada().setLetra(letra);
        
    }
    
    public CasillaDataObject getCasilla(int i, int j){
        return this.tablero[i][j];
    }
    
    public String getCasillaString(int i, int j){
        return this.tablero[i][j].getLetraAsignada().getLetra();
    }
    
    

    public CasillaDataObject[][] getTablero() {
        return tablero;
    }

    public void setTablero(CasillaDataObject[][] tablero) {
        this.tablero = tablero;
    }
    
    @Override
    public String toString(){
        String str="[";
        for(int i=0; i<15; i++){
            str+="[";
            for(int j=0; j<14; j++){
                str+="'"+this.tablero[i][j]+"',";
            }
            str+="'"+this.tablero[i][14]+"']";
            if(i!=14){
                str+=",";
            }
        }
        str+="]";
        return str;
    }
}
